

<form method="POST" id='newmember-edit-form' action="index.php?app=finance&ctl=shopscore&act=add" class="tableform">
        <{input type="hidden" name="pam_account[id]" value=$pam_account.id}>
        <{input type="hidden" name="pam_account[sc_bn]" value=$pam_account.sc_bn}>

    <div class="division">
        <table width="100%" >
            <{ if $pam_account.sc_bn!=''}>

            <tr><th><em class="red">*</em><{t}>单号：<{/t}></th><td><{$pam_account.sc_bn}></td></tr>
            <{/if}>
            <tr><th><em class="red">*</em><{t}>自营店铺：<{/t}></th>

            <td>
             <select name='pam_account[shop_id]' >
                 <{foreach from=$dly_corp item=dly}>
                 <option value='<{$dly.shop_id}>' <{if $pam_account.shop_id==$dly.shop_id }> selected <{/if}>>【<{$dly.shop_bn}>】<{$dly.name}></option>
                 <{/foreach}>
              </select>
            </td></tr>

            <tr><th><em class="red">*</em><{t}>开始日期：<{/t}></th><td><{input type="date" name="pam_account[begin_date]"  value=$pam_account.begin_date  size="20" vtype="required"}></td></tr>
            <tr><th><em class="red">*</em><{t}>结束日期：<{/t}></th><td><{input type="date" name="pam_account[end_date]"  value=$pam_account.end_date  size="20" vtype="required"}></td></tr>
            <tr><th><em class="red">*</em><{t}>入账时间：<{/t}></th><td><{input type="date" name="pam_account[booked_time]" value=$pam_account.booked_time  size="20" vtype="required"}></td></tr>
            <tr><th><{t}>操作员：<{/t}></th><td><{input type="text" name="pam_account[operator]"  value=$pam_account.operator size="20" }></td></tr>
            <tr><th><{t}>备注：<{/t}></th><td><textarea id="remark" maxth="255" rows="3" cols="80%" name="pam_account[remark]" type="textarea"><{$pam_account.remark}></textarea></td></tr>
        </table>
        <hr style="margin:5px 0;">
    </div>
</form>
<{area inject='.mainFoot'}>
<div class="table-action"><{button type="submit"  label=$___b2c="保存"|t:'b2c' id='newmember-edit-form-submit'}></div>
<{/area}>


<script>
    (function(){
        var _form = $('newmember-edit-form');
        var btn =$('newmember-edit-form-submit');
        var finder = finderGroup['<{$env.get.finder_id}>'];

        _form.store('target',{
            onComplete:function(){            

            },
            onSuccess:function(response){
                var hash_res_obj = JSON.decode(response);
                if (hash_res_obj.success != undefined && hash_res_obj.success != "")
                {
                    try{
                        var _dialogIns = btn.getParent('.dialog').retrieve('instance');
                    }catch(e){}

                    if(_dialogIns)
                    {
                        _dialogIns.close();
                        finder.refresh.delay(400,finder);
                    }
                }
                else
                {
                    //alert(hash_res_obj.error);
                }            
            }
        });

        btn.addEvent('click',function(){
            _form.fireEvent('submit',{stop:$empty});



        });

    })();

    function nameCheck(input){
        new Request({
            url:'<{link app=ome ctl=admin_lmparam act=namecheck}>',
            method:'post',
            data:input.name+'='+encodeURIComponent(input.value=input.value.trim()),
            onSuccess: function(rs) {
                rs = JSON.decode(rs);
                if(rs.error) {
                    input.getNext().innerHTML = '<span class="error caution notice-inline">' +rs.error + '</span>';
                }
                else if(rs.success) {
                    input.getNext().innerHTML = '<span class="success notice-inline">' +rs.success + '</span>';
                }
            }
        }).send();
    }
</script>


